package org.kl.wx.util;

import me.chanjar.weixin.common.session.WxSessionManager;
import me.chanjar.weixin.mp.api.WxMpMessageHandler;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;

import java.util.Map;

/**
 * Created by qianjia on 15/1/22.
 */
public class DemoLogHandler implements WxMpMessageHandler {
	@Override
	public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, Map<String, Object> context, WxMpService wxMpService,
			WxSessionManager sessionManager) {
		System.out.println(wxMessage.toString());
		System.out.println("微信内容：" + wxMessage.getContent() + "  接收方：" + wxMessage.getToUserName() + "  发送方：" + wxMessage.getFromUserName()
				+ "  时间：" + wxMessage.getCreateTime());
		return null;
	}
}
